/**
 * Copyright (C), 2015-2018, XXX有限公司
 * FileName: ManagerStatus
 * Author:   zhouheng
 * Date:     2018/6/18 13:40
 * Description: 状态管理类
 * History:
 * <author>          <time>          <version>          <desc>
 * 作者姓名           修改时间           版本号              描述
 */
package com.hengby.hengcrud.core.common.status;

import lombok.Getter;
import lombok.Setter;

/**
 * 〈一句话功能简述〉<br> 
 * 〈状态管理类〉
 *
 * @author zhouheng
 * @create 2018/6/18
 * @since 1.0.0
 */
public enum ManagerStatus {
    OK(1, "启用"),
    FREEZED(2, "冻结"),
    DELETED(3, "被删除");

    int code;
    String message;

    ManagerStatus(int code, String message) {

    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public static String valueOf(Integer value) {
        if (value == null) {
            return "";
        } else {
            for (ManagerStatus ms : ManagerStatus.values()) {
                if (ms.getCode() == value) {
                    return ms.getMessage();
                }
            }
            return "";
        }
    }

}